package com.thoughtworks.yuyijq.generate.element;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * User: yuyijq
 * Date: Oct 10, 2010
 * Time: 2:27:45 PM
 */
public class MethodSignatureElement implements MemberElement {
    public String getSignatureStatement() {
        return signatureStatement;
    }

    private String signatureStatement;

    public int read(String source) {
        signatureStatement = source.substring(0, source.indexOf(')')+1);
        int readLenght = signatureStatement.length();
        signatureStatement = signatureStatement.trim();
        source = source.substring(readLenght);
        return readLenght;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this).
                append("signatureStatement", signatureStatement).
                toString();
    }
}
